package com.pine.app.module.security.core;

/**
 * @author xiaoyuan
 * @create 2020/3/9 13:35
 **/
public class SecurityContextHolder {

    private static SecurityContext securityContext;


    public static SecurityContext getContext(){
        return securityContext;
    }

    public static void setContext(Authentication authentication) {
        securityContext.setContext(authentication);
    }
    public static void clearContext(){
        securityContext.removeAuthentication();
    }

    private static void initialize(){
        if(securityContext == null){
            securityContext = new SecurityContext();
        }
    }


     static
    {
        initialize();
    }

}
